package edu.gyc.homework;

public class Singer {
    public static void main(String[] args) {
        int[] score = {90, 78, 90, 96, 67, 86, 78, 92, 79, 85}; //
        int sum = 0;
        int max = score[0];
        int min = score[0];

        for (int i = 0; i < score.length; i++) {
            sum += score[i];

        }

        for (int i = 1; i < score.length; i++) {

            if (max < score[i]) {
                max = score[i];
            }
        }

        for (int i = 1; i < score.length; i++) {

            if (min > score[i]) {
                min = score[i];
            }
        }

        double avg = (sum - max - min) / 8.0;
        System.out.println(avg);
    }
}
